<script setup>
import {ref} from "vue"
import { channelGetService } from "@/api/channel"

const channelList = ref([])
// 获取文章分类列表
const getChannelList = async () => {
  const res = await channelGetService()
  channelList.value = res.data
}
getChannelList()

defineProps({
  modelValue: {
    type: [Number,String]
  },
  width: {
    type: String
  }
})

</script>

<template>
  <el-select :modelValue="modelValue" @update:modelValue="$emit('update:modelValue', $event)" :style="{width}">
    <el-option v-for="item in channelList"
               :key="item.id"
               :label="item.cate_name"
               :value="item.id"
    />
  </el-select>
</template>

